<template>
  <div class='container'>
    <BaseButton
      v-for="item in actionList"
      :key="item.index"
      :loading="item.loading"
      :isText="item.isText"
      :disabled="item.disabled"
      :round="item.round"
      :type="item.type"
      :icon="item.icon"
      :size="item.size"
      @handleClick="item.action"
    >
      {{ item.text }}
    </BaseButton>
  </div>
  <div class="fill"></div>
</template>

<script setup lang="ts" name="SearchAction">
import { BaseButton } from "@components/BaseForm/index"
interface buttonType {
  index: number,
  loading: boolean,
  isText: boolean,
  disabled: boolean,
  round: boolean,
  type: string,
  icon?: string,
  size?: string,
  text: string,
  btnType: string,
  action: ()=>void
}
let props = defineProps<{
  actionList: buttonType[]
}>()

let emit = defineEmits(['refresh'])

// 操作成功后通知父级
function handleRefresh () {
  emit('refresh', 'ok')
}
</script>

<style lang="less" scoped>
 .container {

 }
 .fill {
  height: 24px;
  background-color: #f9f9f9;
 }
</style>
